<?php



/**
 * Skeleton subclass for representing a row from the 'view_bonus_report' table.
 *
 *
 *
 * You should add additional methods to this class to meet the
 * application requirements.  This class will only be generated as
 * long as it does not already exist in the output directory.
 *
 * @package    propel.generator.empeval
 */
class EmpevalViewBonusReport extends EmpevalBaseViewBonusReport
{
	
	public function calculateBonusValue($individualValue) {
		$value = 0.00;
		foreach ($this->getKpis() as $kpi) {
			$value += $kpi->getWeightResult();
		}
		foreach ($this->getTaskGoalss() as $tg) {
			$value += $tg->getWeightResult();
		}
		return $value * $individualValue / 100;
	}
	
	public function calculateRealizationValue($bonusValue, $individualValue) {
		return ($bonusValue / 100) / ($individualValue / 100) * 100;
	}
	
}
